//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类;

import java.util.Arrays;

public class demo_1672 {
    public demo_1672() {
    }

    public int maximumWealth(int[][] accounts) {
        int[] val = new int[accounts.length];

        for(int i = 0; i < accounts.length; ++i) {
            for(int j = 0; j < accounts[i].length; ++j) {
                val[i] += accounts[i][j];
            }
        }

        Arrays.sort(val);
        return val[val.length - 1];
    }

    public int maximumWealth2(int[][] accounts) {
        int max = Integer.MIN_VALUE;

        for(int[] account : accounts) {
            max = Math.max(max, Arrays.stream(account).sum());
        }

        return max;
    }
}
